<?php

/**
 * blog actions.
 *
 * @package    vanilla
 * @subpackage blog
 * @author     Emiliano Nobis <emiliano.nobis@gmail.com>
 * @version    SVN: $Id: actions.class.php 12479 2008-10-31 10:54:40Z fabien $
 */
class blogActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
      $month = $request->getParameter('month');
      $year = $request->getParameter('year');
      if($month != '' && $year != '') {
        $this->posts = VanillaPostPeer::getByMonth($month, $year);
        $this->numPost = count($this->posts);
      } else {
        $this->posts = VanillaPostPeer::getLastPost();
        $this->numPost = count($this->posts);
      }
            
  }

  public function executeRead(sfWebRequest $request) {
      $this->post = $this->getRoute()->getObject();
  }

  
}
